
from cms.views import cms
from flask import session,g
from cms.models import admin as Admin
from setting import CMS_USER_ID
from cms.models import cmsPermission

@cms.before_request
def before_request():
    if CMS_USER_ID in session:
        user_id=session.get(CMS_USER_ID)
        user=Admin.query.get(3)
        if user:
            g.user=user

@cms.context_processor
def set_cmsPermission():
    return {"cmsPermission":cmsPermission}